//    Copyright (C) Kherty.  All rights reserved.
using System.Collections.Generic;
using System.Windows;
using OpenLS.Spreadsheet.Functions;

namespace OpenLS.Spreadsheet.UI
{
    /// <summary>
    /// Interaction logic for InsertFunctionWindow.xaml
    /// </summary>

    public partial class InsertFunctionControl
    {

        public InsertFunctionControl()
        {
            Resources.MergedDictionaries.Add(new DialogResources());
            InitializeComponent();
        }
      
	
        void OnLoaded(object sender, RoutedEventArgs args)
        {
            List<Function> l = new List<Function>();
            l.AddRange(FunctionManager.BasicFunctions);
            l.AddRange(FunctionManager.LogicalFunctions);
            l.AddRange(FunctionManager.LookupReferenceFunctions);
            l.AddRange(FunctionManager.TextFunctions);
            l.AddRange(FunctionManager.FinancialFunctions);
            l.AddRange(FunctionManager.DateTimeFunctions);
            DataContext = l;
        }
        void OnSelectionChanged(object sender, object args)
        {
            okButton.IsEnabled = true;
        }
        public Function SelectedFunction { get { return listBox.SelectedItem as Function; } }

    }
}